package com.sy.repository;

import com.sy.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * @author zbbstart
 * @date 2021/1/28 - 19:11
 */
public interface UserRepository extends JpaRepository<User,Integer> {
    /**
     * 自定义
     * @param username 用户名
     * @return         用户
     */
    @Query("select u from User u where u.username=:username")
    User getUserInfoByUserName(@Param("username") String username);

}
